<div class="panel panel-default" ng-controller="AgencyOrderCtrl">
	<div class="panel-heading">代售业务 / 代售业务管理</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderNo" class="form-control"
						placeholder="订单号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__contactName"
						class="form-control" placeholder="联系人姓名">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__contactPhone"
						class="form-control" placeholder="联系人手机号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
						<ui-select-match placeholder="订单状态">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="status in statusList | propsFilter: {name: $select.search}">
						<span ng-bind-html=" status.name| highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined" class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-1">
				<div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control"
							datepicker-popup="{{format}}" is-open="opened"
							ng-model="timeRange.startTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="订单开始时间" readOnly /> <span
							class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control"
							datepicker-popup="{{format}}" is-open="opened"
							ng-model="timeRange.endTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="订单结束时间" readOnly /> <span
							class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="starList.selected" theme="bootstrap">
						<ui-select-match placeholder="始发客运站">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="star in starList | propsFilter: {name: $select.search}">
						<span ng-bind-html=" star.name| highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
						<span class="input-group-btn">
							<button ng-click="starList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" has-authority="BOOKING">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="agencyList.selected" theme="bootstrap">
							<ui-select-match placeholder="选择代售点">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="agency in agencyList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" agency.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="agencyList.selected = undefined" class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-1" >
				<div class="col-md-11" >
					<button type="button" class="btn btn-info" ng-click="total()">订单汇总</button>
				</div>
			</div>
		</form>
	</div>
	<p ng-show="flag" class="m-l-xl">
		订单总金额：{{summary[1] |number:2 |defaultValue:0.00}}元，&nbsp;
		订单应付金额：{{summary[2] |number:2 |defaultValue:0.00}}元，&nbsp;
		退票总金额：{{summary[3] |number:2 |defaultValue:0.00}}元，&nbsp;
		总票数：{{summary[0] |defaultValue:0}}张，&nbsp;
		退票数： {{summary[4] |defaultValue:0}}张，&nbsp;
		实际收入：{{summary[5] |number:2 |defaultValue:0.00}}元，&nbsp;
        保险应付：{{summary[6] |number:2 |defaultValue:0.00}}元，&nbsp;
        保险退款：{{summary[7] |number:2 |defaultValue:0.00}}元。&nbsp;
	</p>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width: 20px;"></th>
					<th>代售点</th>
					<th>订单编号</th>
					<th>联系人</th>
					<th>联系手机</th>
					<th>订单总金额</th>
					<th>应付金额</th>
					<th>购票数</th>
					<th>退款金额</th>
					<th>退票数</th>
					<th>下单时间</th>
					<th>订单状态</th>
					<th>始发站</th>
					<th>
						<a href tooltip="导出excel表格">
							<i class="fa fa-download" ng-click="export()"></i>
						</a>
					</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="order in dataList">
					<td></td>
					<td>{{order.agencyName}}</td>
					<td>{{order.orderNo}}</td>
					<td>{{order.contactName}}</td>
					<td>{{order.contactPhone}}</td>
					<td>{{order.totalPrice | number:2 |defaultValue:0.00}}</td>
					<td>{{order.payPrice | number:2 |defaultValue:0.00}}</td>
					<td>{{order.tickets |defaultValue:0}}</td>
					<td>{{order.refundPrice | number:2 |defaultValue:0.00}}</td>
					<td>{{order.refundTickets |defaultValue:0}}</td>
					<td>{{order.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
					<td>{{order.status | orderFilter}}</td>
					<td>{{order.startStation}}</td>
					<td></td>
				</tr>
				<tr ng-show="dataList==''">
					<td colspan="14" style="text-align: center;">暂无订单信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer />
</div>